﻿
using System.Collections;
using System.Xml.Serialization;

namespace VTCeBank.SSO.Utils
{
    /// <summary>
    /// Author: Pham Trong Tai
    /// </summary>
    [XmlRoot("accountinfo")]
    public class AccountInfoList
    {

        private ArrayList accountInfoList;
        [XmlElement("AccountInfo")]
        public AccountInfo[] AccountInfos
        {
            get
            {
                AccountInfo[] items = new AccountInfo[accountInfoList.Count];
                accountInfoList.CopyTo(items);
                return items;
            }
            set
            {
                if (value == null) return;
                AccountInfo[] sites = (AccountInfo[])value;
                accountInfoList.Clear();
                foreach (AccountInfo item in sites)
                    accountInfoList.Add(item);
            }
        }

        public int AddSite(AccountInfo accountInfo)
        {
            return accountInfoList.Add(accountInfo);
        }

    }

    public class AccountInfo
    {
        [XmlAttribute("AccountID")]
        public string Id;
        [XmlAttribute("AccountName")]
        public string AccountName;
        [XmlAttribute("Email")]
        public string Email;
        public AccountInfo()
        {
        }

        public AccountInfo(string id, string accountName, string email)
        {
            this.Id = id;
            this.AccountName = accountName;
            this.Email = email;
        }

    }
}
